<template>
	<view>
		<view class=" none-audition" v-if="auditionList.length == 0">
			暂无试听！
		</view>
		<view class="audition-container" v-else>
		    <view class="audition-content" v-for="(item,index) in auditionList" :key="index">
				<view class="ac-name">{{item.name}} 1</view>
				<view class="ac-subject">试听课程： <test style="color: #000;">{{item.courseName}}</test> </view>
				 <view class="ac-subject">提交时间：<test style="color: #000;">{{item.createtime}}</test></view>
				 <view class="ac-actime"> <u-icon name="clock"></u-icon>试听时间：{{item.startTime}}-{{item.stopTime}}</view>
				 <view class="ac-img" v-if="item.status === '0'"><img src="../../static/listen/yuyue.png" alt="" style="width: 100%; height: 100%;" /></view>
				 <view class="ac-img" v-if="item.status === '1'"><img src="../../static/listen/yique.png" alt="" style="width: 100%; height: 100%;" /></view>
				 <view class="ac-img" v-if="item.status === '2'"><img src="../../static/listen/yiqu.png" alt="" style="width: 100%; height: 100%;" /></view>
			</view>
		</view>
		<view class="bottom-tabbar">
			<view class="tab-one" @click="goBackHome">
				<view class="tab-img"><u-icon name="home"></u-icon></view>
				<view class="tab-name">主页</view>
			</view>
			<view class="tab-one" @click="telShowBtn">
				<view class="tab-img"><u-icon name="phone"></u-icon></view>
				<view class="tab-name">咨询</view>
			</view>
		
			<view class="tab-three" style="background-color: #c90d36;" @click="appointListen">
				我要预约试听
			</view>
		</view>	
		<telPage></telPage>	
	</view>
</template>

<script>
		import telPage from '@/components/telPage.vue';
	import {
	getAppointListen
	} from '@/utils/api.js'
	export default {
		components: {
		
			telPage
		},
		data() {
			return {
				auditionList:[]
			}
		},
		onLoad(){
			this.getAppointListen()
		},
		methods: {
			appointListen(){
				uni.navigateTo({
					url: '/pages/course/courseList'
				})
			},
			async getAppointListen(){
				uni.showLoading()
				const data = {
					pageSize:999,
					pageNum:1,
				}
				const res = await getAppointListen(data)
				if(res.code == 200){
					uni.hideLoading()
					this.auditionList = res.rows
				}
			    
			},
			goBackHome(){
				uni.redirectTo({
					url:'/pages/index/index'
				})
			},
			telShowBtn(){
				uni.$emit("telShow",true)
				// console.log("1",telShow);
			},
		}
	}
</script>

<style>
	page {
		background-color: #efefef;
	}
</style>

<style scoped lang="scss">
.none-audition{
	text-align: center;
	margin-top: 100rpx;
}
	.bottom-tabbar {
		position: fixed;
		bottom: 0;
		width: 100%;
		height: 100rpx;
		background-color: #ffffff;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0 30rpx;
	}
	
	.tab-one {
		width: 90rpx;
		text-align: center;
	}
	
	.tab-name {
		margin-top: 8rpx;
	}
	
	.tab-three {
		width: 400rpx;
		height: 70rpx;
		text-align: center;
		line-height: 70rpx;
		color: #ffffff;
		border-radius: 100rpx;
	
	}
	.audition-content{
		width: 95%;
		margin: 20rpx auto;
		background-color: #fff;
		border-radius: 10rpx;
		padding: 40rpx 20rpx;
		box-sizing: border-box;
		position: relative;
	}
	.ac-name{
		font-weight: bold;
		font-size: 32rpx;
	}
	.ac-subject{
		color: #aaa8a8;
		margin-top: 10rpx;
	}
	.ac-actime{
		width:100%;
		padding: 8rpx 18rpx;
		margin: 10rpx auto;
		background-color: #f9e6ca;
		color: #ff9800 ;
	}
	.ac-img{
		width: 100rpx;
		height: 100rpx;
		position: absolute;
		right: 40rpx;
		top: 50rpx;
	}
</style>
